@echo on
@REM Pack SDK files
@REM @author lance.liao@cygia.com

@echo off
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set timStamp=%YYYY%%MM%%DD%_%HH%%Min%

set fileName="ILC_BUTTON_CG_SDK_v1.1.11_build_%timStamp%.tar.gz"

echo Packing SDK files to %fileName%
@echo on
tar.exe --exclude=./FilterSDK/easylogging++.h ^
 --exclude=./FilterSDK/ap_base64.h ^
 --exclude=./FilterSDK/tinytiff* ^
 --exclude=./FilterSDK/sqlite* ^
 --exclude=./FilterSDK/SQLiteSession.h ^
 --exclude=./x64/Release/*.log ^
 --exclude=./x64/Debug/*.log ^
 -cvzf %fileName% ^
.\SDKDemo.sln .\clean.bat .\gentime.bat .\DemoFilter\* ^
 .\FilterSDK\*.h  .\FilterSDK\FilterExtern.cpp .\FilterCommon\* .\SharedLibs\* .\x64\* .\Changelog.md

@echo off
echo Done packing SDK files to %fileName%
@pause